package LEI.lei;
//匿名内部类
public class test12 {
    public static void main(String[] args) {

        new Swim() {
            @Override
            public void swim() {
                System.out.println("重写了游泳的方法");
            }
        };

        new Animal() {
            public void eat() {
                System.out.println("重写了eat方法");
            }
        };
    }
        public static void method (Animal a){

        }
    }

